package com.example.idlefish.GoodsInfo.ActivityContract

import android.content.Context
import android.content.Intent
import androidx.activity.result.contract.ActivityResultContract
import com.example.idlefish.GoodsInfo.MapActivity

class BaiduMapActivityContract:ActivityResultContract<Unit, String?>(){
    override fun createIntent(context: Context, input: Unit): Intent {
        val intent = Intent(context, MapActivity::class.java)
        return intent
    }

    override fun parseResult(resultCode: Int, intent: Intent?): String? {
        if (intent != null) {
            return intent.getStringExtra("address")
        }
        return ""
    }
}